/*
 * @Author: zhanglianchang
 * @Date: 2020-08-01 14:39:32
 * @Last Modified by: taoshiwei
 * @Last Modified time: 2019-04-29 14:57:26
 *
 * 标签有关的接口：自己写吧~~  已经被张老师删了 ^_^
 */
// export const editTag = data => createAPI(`/tags/${data.id}`, "put", data);
// export const removeTag = data => createAPI(`/tags/${data.id}`, "delete", data);
// export const addTag = data => createAPI("/tags", "post", data);
// export const changeTagState = data =>
//   createAPI(`/tags/${data.id}/${data.state}`, "post", data);
// export const getSubjectList = data => createAPI("/subjects", "get", data);

import { createAPI } from "@/utils/request";
export const getDataList = data => createAPI("/tags", "get", data);
// 2
export const deleteDataList = id => createAPI(`/tags/${id}`, "delete");
// 4
export const sendchangeState = data =>
  createAPI(`/tags/${data.id}/${data.state}`, "post", data);
// 1
export const editSubjectName = data =>
  createAPI(`/tags/${data.id}`, "put", data);
// 3
export const addTag = data => createAPI(`/tags`, "post", data);
// 5
export const getSubjectList = data => createAPI(`/subjects`, "get", data);

// 标签列表
export const list = data => createAPI("/tags", "get", data);

// 标签简单列表 data中有subjectID可以查询学科下标签
export const simple = data => createAPI("/tags/simple", "get", data);

// 标签详情
export const detail = data => createAPI(`/tags/${data.id}`, "get", data);

// 标签添加
export const add = data => createAPI("/tags", "post", data);

// 标签修改
export const update = data => createAPI(`/tags/${data.id}`, "put", data);

// 标签删除
export const remove = data => createAPI(`/tags/${data.id}`, "delete", data);

// 标签状态
export const removed = (data) =>
  createAPI(`/tags/${data.id}/state`, 'post', data)
export const changeState = (data) =>
  createAPI(`/tags/${data.id}/${data.state}`, 'post', data)

export const editTag = (data) => createAPI(`/tags/${data.id}`, 'put', data)
export const removeTag = (data) => createAPI(`/tags/${data.id}`, 'delete', data)
// export const addTag = (data) => createAPI('/tags', 'post', data)
export const changeTagState = (data) =>
  createAPI(`/tags/${data.id}/${data.state}`, 'post', data)
// export const getSubjectList = (data) => createAPI('/subjects', 'get', data)
